package com.server.common.logistics.dsf.create;

import com.google.gson.annotations.SerializedName;
import com.server.common.logistics.request.LogisticsRequest;
import lombok.Data;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

import java.util.List;

/**
 * @author chenpy
 * @date 2020/12/23 11:31
 */
@NoArgsConstructor
@Getter
@Setter
public class DSFCreateOrderRequest extends LogisticsRequest {

    @SerializedName("4px_tracking_no")
    private String trackingNumber;
    @SerializedName("ref_no")
    private String refNo;
    @SerializedName("business_type")
    private String businessType;
    @SerializedName("duty_type")
    private String dutyType;
    @SerializedName("cargo_type")
    private String cargoType;
    @SerializedName("vat_no")
    private String vatNo;
    @SerializedName("eori_no")
    private String eoriNo;
    @SerializedName("buyer_id")
    private String buyerId;
    @SerializedName("sales_platform")
    private String salesPlatform;
    @SerializedName("seller_id")
    private String sellerId;
    @SerializedName("logistics_service_info")
    private LogisticsServiceInfo logisticsServiceInfo;
    @SerializedName("label_barcode")
    private String labelBarcode;
    @SerializedName("return_info")
    private ReturnInfo returnInfo;
    @SerializedName("parcel_list")
    private List<ParcelList> parcelList;
    @SerializedName("is_insure")
    private String isInsure;
    @SerializedName("insurance_info")
    private InsuranceInfo insuranceInfo;
    @SerializedName("sender")
    private Sender sender;
    @SerializedName("recipient_info")
    private RecipientInfo recipientInfo;
    @SerializedName("deliver_type_info")
    private DeliverTypeInfo deliverTypeInfo;
    @SerializedName("label_config_info")
    private LabelConfigInfo labelConfigInfo;

    @NoArgsConstructor
    @Getter
    @Setter
    public static class LogisticsServiceInfo {
        @SerializedName("logistics_product_code")
        private String logisticsProductCode;
        @SerializedName("customs_service")
        private String customsService;
        @SerializedName("signature_service")
        private String signatureService;
        @SerializedName("value_added_services")
        private String valueAddedServices;
    }

    @NoArgsConstructor
    @Getter
    @Setter
    public static class ReturnInfo {
        @SerializedName("is_return_on_domestic")
        private String isReturnOnDomestic;
        @SerializedName("domestic_return_addr")
        private DomesticReturnAddr domesticReturnAddr;
        @SerializedName("is_return_on_oversea")
        private String isReturnOnOversea;
        @SerializedName("oversea_return_addr")
        private OverseaReturnAddr overseaReturnAddr;

        @NoArgsConstructor
        @Data
        public static class DomesticReturnAddr {
            @SerializedName("first_name")
            private String firstName;
            @SerializedName("last_name")
            private String lastName;
            @SerializedName("company")
            private String company;
            @SerializedName("phone")
            private String phone;
            @SerializedName("phone2")
            private String phone2;
            @SerializedName("email")
            private String email;
            @SerializedName("post_code")
            private String postCode;
            @SerializedName("country")
            private String country;
            @SerializedName("state")
            private String state;
            @SerializedName("city")
            private String city;
            @SerializedName("district")
            private String district;
            @SerializedName("street")
            private String street;
            @SerializedName("house_number")
            private String houseNumber;
        }

        @NoArgsConstructor
        @Data
        public static class OverseaReturnAddr {
            @SerializedName("first_name")
            private String firstName;
            @SerializedName("last_name")
            private String lastName;
            @SerializedName("company")
            private String company;
            @SerializedName("phone")
            private String phone;
            @SerializedName("phone2")
            private String phone2;
            @SerializedName("email")
            private String email;
            @SerializedName("post_code")
            private String postCode;
            @SerializedName("country")
            private String country;
            @SerializedName("state")
            private String state;
            @SerializedName("city")
            private String city;
            @SerializedName("district")
            private String district;
            @SerializedName("street")
            private String street;
            @SerializedName("house_number")
            private String houseNumber;
        }
    }

    @NoArgsConstructor
    @Getter
    @Setter
    public static class InsuranceInfo {
        @SerializedName("insure_type")
        private String insureType;
        @SerializedName("insure_value")
        private Integer insureValue;
        @SerializedName("currency")
        private String currency;
        @SerializedName("insure_person")
        private String insurePerson;
        @SerializedName("certificate_type")
        private String certificateType;
        @SerializedName("certificate_no")
        private String certificateNo;
        @SerializedName("category_code")
        private String categoryCode;
        @SerializedName("insure_product_name")
        private String insureProductName;
        @SerializedName("package_qty")
        private String packageQty;
    }

    @NoArgsConstructor
    @Getter
    @Setter
    public static class Sender {
        @SerializedName("first_name")
        private String firstName;
        @SerializedName("last_name")
        private String lastName;
        @SerializedName("company")
        private String company;
        @SerializedName("phone")
        private String phone;
        @SerializedName("phone2")
        private String phone2;
        @SerializedName("email")
        private String email;
        @SerializedName("post_code")
        private String postCode;
        @SerializedName("country")
        private String country;
        @SerializedName("state")
        private String state;
        @SerializedName("city")
        private String city;
        @SerializedName("district")
        private String district;
        @SerializedName("street")
        private String street;
        @SerializedName("house_number")
        private String houseNumber;
        @SerializedName("certificate_info")
        private CertificateInfo certificateInfo;

        @NoArgsConstructor
        @Data
        public static class CertificateInfo {
            @SerializedName("certificate_type")
            private String certificateType;
            @SerializedName("certificate_no")
            private String certificateNo;
            @SerializedName("id_front_url")
            private String idFrontUrl;
            @SerializedName("id_back_url")
            private String idBackUrl;
        }
    }

    @NoArgsConstructor
    @Getter
    @Setter
    public static class RecipientInfo {
        @SerializedName("first_name")
        private String firstName;
        @SerializedName("last_name")
        private String lastName;
        @SerializedName("company")
        private String company;
        @SerializedName("phone")
        private String phone;
        @SerializedName("phone2")
        private String phone2;
        @SerializedName("email")
        private String email;
        @SerializedName("post_code")
        private String postCode;
        @SerializedName("country")
        private String country;
        @SerializedName("state")
        private String state;
        @SerializedName("city")
        private String city;
        @SerializedName("district")
        private String district;
        @SerializedName("street")
        private String street;
        @SerializedName("house_number")
        private String houseNumber;
        @SerializedName("certificate_info")
        private CertificateInfo certificateInfo;

        @NoArgsConstructor
        @Data
        public static class CertificateInfo {
            @SerializedName("certificate_type")
            private String certificateType;
            @SerializedName("certificate_no")
            private String certificateNo;
            @SerializedName("id_front_url")
            private String idFrontUrl;
            @SerializedName("id_back_url")
            private String idBackUrl;
        }
    }

    @NoArgsConstructor
    @Getter
    @Setter
    public static class DeliverTypeInfo {
        @SerializedName("deliver_type")
        private String deliverType;
        @SerializedName("warehouse_code")
        private String warehouseCode;
        @SerializedName("pick_up_info")
        private PickUpInfo pickUpInfo;
        @SerializedName("express_to_4px_info")
        private ExpressTo4pxInfo expressTo4pxInfo;
        @SerializedName("self_send_to_4px_info")
        private SelfSendTo4pxInfo selfSendTo4pxInfo;

        @NoArgsConstructor
        @Data
        public static class PickUpInfo {
            @SerializedName("expect_pick_up_earliest_time")
            private String expectPickUpEarliestTime;
            @SerializedName("expect_pick_up_latest_time")
            private String expectPickUpLatestTime;
            @SerializedName("pick_up_address_info")
            private PickUpAddressInfo pickUpAddressInfo;

            @NoArgsConstructor
            @Data
            public static class PickUpAddressInfo {
                @SerializedName("first_name")
                private String firstName;
                @SerializedName("last_name")
                private String lastName;
                @SerializedName("company")
                private String company;
                @SerializedName("phone")
                private String phone;
                @SerializedName("phone2")
                private String phone2;
                @SerializedName("email")
                private String email;
                @SerializedName("post_code")
                private String postCode;
                @SerializedName("country")
                private String country;
                @SerializedName("state")
                private String state;
                @SerializedName("city")
                private String city;
                @SerializedName("district")
                private String district;
                @SerializedName("street")
                private String street;
                @SerializedName("house_number")
                private String houseNumber;
            }
        }

        @NoArgsConstructor
        @Data
        public static class ExpressTo4pxInfo {
            @SerializedName("express_company")
            private String expressCompany;
            @SerializedName("tracking_no")
            private String trackingNo;
        }

        @NoArgsConstructor
        @Data
        public static class SelfSendTo4pxInfo {
            @SerializedName("booking_earliest_time")
            private String bookingEarliestTime;
            @SerializedName("booking_latest_time")
            private String bookingLatestTime;
        }
    }

    @NoArgsConstructor
    @Getter
    @Setter
    public static class LabelConfigInfo {
        @SerializedName("label_size")
        private String labelSize;
        @SerializedName("response_label_format")
        private String responseLabelFormat;
        @SerializedName("create_logistics_label")
        private String createLogisticsLabel;
        @SerializedName("logistics_label_config")
        private LogisticsLabelConfig logisticsLabelConfig;
        @SerializedName("create_package_label")
        private String createPackageLabel;

        @NoArgsConstructor
        @Data
        public static class LogisticsLabelConfig {
            @SerializedName("is_print_time")
            private String isPrintTime;
            @SerializedName("is_print_buyer_id")
            private String isPrintBuyerId;
            @SerializedName("is_print_pick_info")
            private String isPrintPickInfo;
        }
    }

    @NoArgsConstructor
    @Getter
    @Setter
    public static class ParcelList {
        @SerializedName("weight")
        private Integer weight;
        @SerializedName("length")
        private Integer length;
        @SerializedName("width")
        private Integer width;
        @SerializedName("height")
        private Integer height;
        @SerializedName("parcel_value")
        private Double parcelValue;
        @SerializedName("currency")
        private String currency;
        @SerializedName("include_battery")
        private String includeBattery;
        @SerializedName("battery_type")
        private String batteryType;
        @SerializedName("product_list")
        private List<ProductList> productList;
        @SerializedName("declare_product_info")
        private List<DeclareProductInfo> declareProductInfo;

        @NoArgsConstructor
        @Data
        public static class ProductList {
            @SerializedName("sku_code")
            private String skuCode;
            @SerializedName("standard_product_barcode")
            private String standardProductBarcode;
            @SerializedName("product_name")
            private String productName;
            @SerializedName("product_description")
            private String productDescription;
            @SerializedName("product_unit_price")
            private Integer productUnitPrice;
            @SerializedName("currency")
            private String currency;
            @SerializedName("qty")
            private Integer qty;
        }

        @NoArgsConstructor
        @Data
        public static class DeclareProductInfo {
            @SerializedName("declare_product_code")
            private String declareProductCode;
            @SerializedName("declare_product_name_cn")
            private String declareProductNameCn;
            @SerializedName("declare_product_name_en")
            private String declareProductNameEn;
            @SerializedName("uses")
            private String uses;
            @SerializedName("specification")
            private String specification;
            @SerializedName("component")
            private String component;
            @SerializedName("unit_net_weight")
            private Integer unitNetWeight;
            @SerializedName("unit_gross_weight")
            private Integer unitGrossWeight;
            @SerializedName("material")
            private String material;
            @SerializedName("declare_product_code_qty")
            private Integer declareProductCodeQty;
            @SerializedName("unit_declare_product")
            private String unitDeclareProduct;
            @SerializedName("origin_country")
            private String originCountry;
            @SerializedName("country_export")
            private String countryExport;
            @SerializedName("country_import")
            private String countryImport;
            @SerializedName("hscode_export")
            private String hscodeExport;
            @SerializedName("hscode_import")
            private String hscodeImport;
            @SerializedName("declare_unit_price_export")
            private Integer declareUnitPriceExport;
            @SerializedName("currency_export")
            private String currencyExport;
            @SerializedName("declare_unit_price_import")
            private Double declareUnitPriceImport;
            @SerializedName("currency_import")
            private String currencyImport;
            @SerializedName("brand_export")
            private String brandExport;
            @SerializedName("brand_import")
            private String brandImport;
            @SerializedName("sales_url")
            private String salesUrl;
            @SerializedName("package_remarks")
            private String packageRemarks;
        }
    }
}
